package com.bosssoft.trainee.nontax.util;

import org.springframework.stereotype.Component;

@Component
public class UserSexToStringFormat {
    public String toStr(Integer sex) {
        if(null == sex){
            return null;
        }
        if (0 == sex) {
            return "女";
        } else {
            return "男";
        }
    }

    public int toInt(String sex) {
        if(null == sex){
            return 1;
        }
        if ("女".equals(sex)) {
            return 0;
        } else {
            return 1;
        }
    }
}
